// pages/Leavemessage/Leavemessage.js
Page({
  data: {
    currentTime: '', // 初始化当前时间
  },

  onLoad: function() {
    this.updateTime();
  },

  updateTime: function() {
    const d = new Date();
    const hour = d.getHours().toString().padStart(2, '0');
    const minute = d.getMinutes().toString().padStart(2, '0');

    const formattedTime = `${hour}:${minute}`;
    this.setData({
      currentTime: formattedTime
    });
  }
});